package Game.Items.Others;

import org.newdawn.slick.SlickException;

import GUI.GuiManager;
import GUI.GuiMessenger;
import Game.Items.GameItem;
import Game.Objects.GOTorch;
import Screens.MyScreens.GameScreen;

/** Game Item - Torch
 * @author Aikidos
 */
public class GITorch extends GameItem {

	public GITorch() {
		super("Torch");
		
		Category = ECategory.Other;
		
		_isStackable = true;
		
		_cost = 20;
		_weight = 0.3f;
	}

	@Override
	public boolean use() throws SlickException {
		
		// Spawn torch to owner object
		GOTorch torch = new GOTorch(_ownerGameObject.getObjectManager());
		torch.Position.set(_ownerGameObject.Position);
		torch.initLight();
		
		// Show message
		GuiManager.getMessenger().addMessage("[green]You[/green] placed a [yellow]" + getName() + "[/yellow]");
		
		return true;
	}
}
